<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: NetwToMacControlInfo Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00157.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">NetwToMacControlInfo Class Reference<div class="ingroups"><a class="el" href="a00518.html">baseUtils - utilities for base MiXiM</a> &#124; <a class="el" href="a00509.html">macLayer - MAC layer modules</a> &#124; <a class="el" href="a00507.html">netwLayer - network layer modules</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="NetwToMacControlInfo" -->
<p>Control info to pass next hop L2 addr from netw to MAC layer.  
 <a href="a00157.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00313_source.html">NetwToMacControlInfo.h</a>&gt;</code></p>

<p><a href="a00901.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0168cc7c80b267f832f7395b31f64f4e"></a><!-- doxytag: member="NetwToMacControlInfo::NetwToMacControlInfo" ref="a0168cc7c80b267f832f7395b31f64f4e" args="(const LAddress::L2Type &amp;addr=LAddress::L2NULL)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00157.html#a0168cc7c80b267f832f7395b31f64f4e">NetwToMacControlInfo</a> (const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;addr=<a class="el" href="a00117.html#a6db1e8dbd0d23dec49ce7b59f5c15976">LAddress::L2NULL</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8408a34b9eb11023c61673c5e6cb84ca"></a><!-- doxytag: member="NetwToMacControlInfo::~NetwToMacControlInfo" ref="a8408a34b9eb11023c61673c5e6cb84ca" args="()" -->
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00157.html#a8408a34b9eb11023c61673c5e6cb84ca">~NetwToMacControlInfo</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af99bf29fa34adcb49a6f53f8c94d43fd"></a><!-- doxytag: member="NetwToMacControlInfo::getNextHopMac" ref="af99bf29fa34adcb49a6f53f8c94d43fd" args="() const " -->
virtual const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00157.html#af99bf29fa34adcb49a6f53f8c94d43fd">getNextHopMac</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Getter method. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a19518c8f5ccf35d44a2813a922e214ef"></a><!-- doxytag: member="NetwToMacControlInfo::getDest" ref="a19518c8f5ccf35d44a2813a922e214ef" args="() const " -->
virtual const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>getDest</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad3884a518785e93c963552dea18e5909"></a><!-- doxytag: member="NetwToMacControlInfo::setNextHopMac" ref="ad3884a518785e93c963552dea18e5909" args="(const LAddress::L2Type &amp;addr)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00157.html#ad3884a518785e93c963552dea18e5909">setNextHopMac</a> (const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;addr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Setter method. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad9984137a14e4f79e8c3d764a52eaaa0"></a><!-- doxytag: member="NetwToMacControlInfo::setDest" ref="ad9984137a14e4f79e8c3d764a52eaaa0" args="(const LAddress::L2Type &amp;addr)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>setDest</b> (const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;addr)</td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static cObject *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00157.html#a9556c1d066423e39247217d7a7f2a456">setControlInfo</a> (cMessage *const pMsg, const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;pDestAddr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attaches a "control info" structure (object) to the message pMsg.  <a href="#a9556c1d066423e39247217d7a7f2a456"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00157.html#add42e098a1af72c3fbc8be746d04b27f">getDestFromControlInfo</a> (const cObject *const pCtrlInfo)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts the MAC address from the "control info" structure (object).  <a href="#add42e098a1af72c3fbc8be746d04b27f"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa7e33f761452ceb1451769d7c59da91a"></a><!-- doxytag: member="NetwToMacControlInfo::nextHopMac" ref="aa7e33f761452ceb1451769d7c59da91a" args="" -->
<a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00157.html#aa7e33f761452ceb1451769d7c59da91a">nextHopMac</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">MAC address of the sending or receiving node. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Control info to pass next hop L2 addr from netw to MAC layer. </p>
<p>Control Info to pass interface information from the network to the MAC layer Currently the only information necessary is the MAC address of the next hop, which has to be determined by ARP or some similar mechanism</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Daniel Willkomm </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="add42e098a1af72c3fbc8be746d04b27f"></a><!-- doxytag: member="NetwToMacControlInfo::getDestFromControlInfo" ref="add42e098a1af72c3fbc8be746d04b27f" args="(const cObject *const pCtrlInfo)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp; NetwToMacControlInfo::getDestFromControlInfo </td>
          <td>(</td>
          <td class="paramtype">const cObject *const&#160;</td>
          <td class="paramname"><em>pCtrlInfo</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Extracts the MAC address from the "control info" structure (object). </p>
<p>Extract the destination MAC address from the "control info" which was prev. set by <a class="el" href="a00157.html#a9556c1d066423e39247217d7a7f2a456" title="Attaches a &quot;control info&quot; structure (object) to the message pMsg.">NetwToMacControlInfo::setControlInfo()</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pCtrlInfo</td><td>The "control info" structure (object) prev. set by <a class="el" href="a00157.html#a9556c1d066423e39247217d7a7f2a456" title="Attaches a &quot;control info&quot; structure (object) to the message pMsg.">NetwToMacControlInfo::setControlInfo()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The MAC address of message receiver. </dd></dl>

<p>Referenced by <a class="el" href="a00026.html#a48135ffa21044a71d92149d5301f9deb">BaseMacLayer::getUpperDestinationFromControlInfo()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="keyword">const</span> <a class="code" href="a00157.html" title="Control info to pass next hop L2 addr from netw to MAC layer.">tNetwToMacControlInfoBase</a> * <span class="keyword">const</span> cCtrlInfo = <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="a00157.html" title="Control info to pass next hop L2 addr from netw to MAC layer.">tNetwToMacControlInfoBase</a> *<span class="keyword">&gt;</span>(pCtrlInfo);

    assert(cCtrlInfo);
    <span class="keywordflow">return</span> cCtrlInfo-&gt;getDest();
}
</pre></div>
</div>
</div>
<a class="anchor" id="a9556c1d066423e39247217d7a7f2a456"></a><!-- doxytag: member="NetwToMacControlInfo::setControlInfo" ref="a9556c1d066423e39247217d7a7f2a456" args="(cMessage *const pMsg, const LAddress::L2Type &amp;pDestAddr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cObject * NetwToMacControlInfo::setControlInfo </td>
          <td>(</td>
          <td class="paramtype">cMessage *const&#160;</td>
          <td class="paramname"><em>pMsg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td>
          <td class="paramname"><em>pDestAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Attaches a "control info" structure (object) to the message pMsg. </p>
<p>This is most useful when passing packets between protocol layers of a protocol stack, the control info will contain the destination MAC address.</p>
<p>The "control info" object will be deleted when the message is deleted. Only one "control info" structure can be attached (the second setL3ToL2ControlInfo() call throws an error).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pMsg</td><td>The message where the "control info" shall be attached. </td></tr>
    <tr><td class="paramname">pDestAddr</td><td>The MAC address of the message receiver. </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="a00156.html#adc1d59fcef6f3bc66765feb3c642a1bf">NetworkStackTrafficGen::sendBroadcast()</a>, and <a class="el" href="a00028.html#a627a9f853785bc061b1423ac6ad9ad21">BaseNetwLayer::setDownControlInfo()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <a class="code" href="a00157.html" title="Control info to pass next hop L2 addr from netw to MAC layer.">tNetwToMacControlInfoBase</a> * <span class="keyword">const</span> cCtrlInfo = <span class="keyword">new</span> <a class="code" href="a00157.html" title="Control info to pass next hop L2 addr from netw to MAC layer.">tNetwToMacControlInfoBase</a>();

    cCtrlInfo-&gt;setDest(pDestAddr);
    pMsg-&gt;setControlInfo(cCtrlInfo);

    <span class="keywordflow">return</span> cCtrlInfo;
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/utils/<a class="el" href="a00313_source.html">NetwToMacControlInfo.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/utils/NetwToMacControlInfo.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00157.html">NetwToMacControlInfo</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:32 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
